using KernelSyntaxExample.Skills;
using KernelSyntaxExample.Utils;
using Microsoft.SemanticKernel;

namespace KernelSyntaxExample;

public class Example05 {
    public async Task RunAsync() {
        // Create a kernel
        var kernel = new KernelBuilder().Configure(p => {
            // Add the Azure Chat Completion service
            p.AddAzureChatCompletionService(
                ProjectEnvironment.Get(ProjectEnvironment.AoaiDeploymentName),
                ProjectEnvironment.Get(ProjectEnvironment.AoaiEndpoint),
                ProjectEnvironment.Get(ProjectEnvironment.AoaiKey));
        }).Build();

        kernel.ImportSkill(new DateTimeSkill(), "DateTimeSkill");
        var solarTermWrite =
            kernel.ImportSemanticSkillFromDirectory(
                ProjectFile.GetSkillsFolder(), "WriterSkill")["SolarTermWrite"];
        var solarTermWriteResult = await kernel.RunAsync(solarTermWrite);
        Console.WriteLine(solarTermWriteResult.Result);
    }
}